import React, { Component } from 'react';
import {user_nav} from '../../utils/api'
class MyCateList extends Component {
    constructor(props){
        super(props);
        this.state={
            navlist:[],
            count:0,
            isshow:false
        }
    }
    componentDidMount(){
        user_nav().then((res)=>{
            if(res.data.code===200){
                this.setState({
                    navlist:res.data.list
                })
            }
        })
    }
    render() {
        return (
            <div className='mycatelist'>
                {
                    this.state.navlist.map((item,index)=>{
                        return (
                            <div className="cate" key={index}>
                                <img src={item.pic} alt="" />
                                <div className='name'>{item.name}</div>
                            </div>
                        )

                    })
                }
                
            </div>
        );
    }
}

export default MyCateList;